﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ThanNhanTao.Server
{
    public class ThanNhanTaoGlobalServer
    {
        private static bvdn_thannhantaoEntities bvdn_thannhantaoEntitiesField;
        public static bvdn_thannhantaoEntities bvdn_thannhantaoEntities 
        {
            get
            {
                if (bvdn_thannhantaoEntitiesField == null)
	            {
                    bvdn_thannhantaoEntitiesField = new bvdn_thannhantaoEntities();
	            }
                return bvdn_thannhantaoEntitiesField;
            }
            set
            {
                bvdn_thannhantaoEntitiesField = value;
            }
        }

        public static void SetConnectionCommon(string dataSource, string dbName, string username, string password, string connectionString)
        {
            connectionString = String.Format(connectionString, dataSource, dbName, username, password);
            bvdn_thannhantaoEntities = new bvdn_thannhantaoEntities(connectionString);
        }
    }
}
